﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using CloudStorage_Backend.service;
using CloudStorage_Backend.dao;
using Microsoft.EntityFrameworkCore;

namespace XUnitTest
{
    public class Startup
    {

        public void ConfigureServices(IServiceCollection services)
        {
            var connectionString = "Server=localhost;Database=cloud-storage-db;User=root;Password=123456;";
            ServerVersion serverVersion = ServerVersion.AutoDetect(connectionString);
            services.AddDbContext<UserContext>(options =>
                options.UseMySql(connectionString, serverVersion));

            services.AddTransient<UserService>();
            services.AddTransient<UserDao>();
            services.AddTransient<FileService>();
        }

        public void Configure(IServiceProvider provider)
        {

        }
    }
}
